import classNames from "../utils/classNames";
import { FC } from "react";

interface MinimalButtonProps {
  isDisabled?: boolean;
  isSelected?: boolean;
  onClick(): void;
}

const MinimalButton: FC<MinimalButtonProps> = ({
  children,
  isDisabled,
  isSelected,
  onClick,
}) => (
  <button
    className={classNames({
      "rpv-core__minimal-button": true,
      "rpv-core__minimal-button--disabled": !!isDisabled,
      "rpv-core__minimal-button--selected": !!isSelected,
    })}
    onClick={onClick}
  >
    {children}
  </button>
);

MinimalButton.defaultProps = {
  isDisabled: false,
  isSelected: false,
};

export default MinimalButton;
